<template>
  <button @click="getTest1">发送Get请求1</button>
  <button @click="getTest2">发送Get请求2</button>
  <button @click="postTest1">发送Post请求1</button>
  <button @click="postTest2">发送Post请求2</button>
</template>

<script setup lang="ts">
import {defineComponent, reactive, ref} from 'vue';
import store from '../stores/index.ts'
import {GetTest1, GetTest2, PostTest3, PostTest4} from "../api";

let counter = store.useCounter();
let getTest1 = () => {
  GetTest1().then((res) => {
    console.log("res:", res);
  })
}

let getTest2 = () => {
  GetTest2({
    userId: 1
  }).then((res) => {
    console.log("res:", res);
  })
}

let postTest1 = () => {
  PostTest3().then((res) => {
    console.log("res:", res);
  })
}

let postTest2 = () => {
  PostTest4({
    id: 1,
    username: "admin",
    password: "123456",
    nickName: "马小跳"
  }).then((res) => {
    console.log("res:", res);
  })
}
</script>

<style scoped>

</style>